export const ProjectChangeQueries = {
    GetProjectChanges: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    `,

    GetDoneProjectChanges: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      projectCheckStatus = '通过'
    `,

    GetInProgressProjectChanges: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      projectCheckStatus = '待审批'
    `,

    GetInProgressProjectChangesByPId: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      projectCheckStatus = '待审批'
      AND
      pId = ?
    `,

  
    GetProjectChangeById: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerEmployeeId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      id = ?
    `,

    GetProjectChangeByProjects: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerEmployeeId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      pId in ?
    `,

    GetDoneProjectChangesByGroups: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerEmployeeId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      projectChangeType in ('成员变更', '经费变更', '延期变更')
    AND
      projectGroupId in ?
    `,

    GetProjectChangeByPId: `
    SELECT
      id,
      pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerEmployeeId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus
    FROM my_schema.project_change
    WHERE
      pId = ?
    `,

    AddProjectChange: `
    INSERT INTO my_schema.project_change (pId,
      projectId,
      projectName,
      projectOwnerId,
      projectOwnerEmployeeId,
      projectOwnerName,
      projectOwnerPhone,
      projectOwnerEmail,
      projectDepartment,
      projectChangeRequestorId,
      projectChangeRequestorName,
      projectChangeType,
      projectMembers,
      projectAppliedCost,
      projectAppliedCostItems,
      projectCreatedDate,
      projectStartDate,
      projectExpectedEndDate,
      projectCheckStatus,
      projectChangeRequestDate,
      projectReviewComment,
      projectReviewerId,
      projectReviewerName,
      projectReviewerDate,
      projectGroupName,
      projectGroupId,
      projectStatus)
      VALUES ?
    `,

    UpdateProjectChangeById: `
    UPDATE my_schema.project_change
    SET ?
    WHERE
      id = ?
    `,
  
    DeleteProjectChangeById: `
    DELETE FROM my_schema.project_change
    WHERE
      id = ?
    `
  };